<?php
/* @var $this ConfigurationController */
/* @var $model Configuration */
/* @var $form CActiveForm */
?>
<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'configuration-detail-form',
	'htmlOptions'=>array('enctype'=>'multipart/form-data'),
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// See class documentation of CActiveForm for details on this,
	// you need to use the performAjaxValidation()-method described there.
	'enableAjaxValidation'=>true,
	'clientOptions'=>array('validateOnSubmit'=>true),
)); ?>
	<h3>Configuration</h3>
	<p class="note">Fields with <span class="required">*</span> are required.</p>
    <table>
        <tr>
            <td class="td-text-align"><?php echo $form->labelEx($model,'filename'); ?></td>
            <td class="td-file-upload" valign="middle">
				<?php
					if ($model->id > 0 && $model->filename != '')
					{
						echo CHtml::link($model->filename, Yii::app()->request->baseUrl.'/'.Yii::app()->params->uploadPath.'/'.$model->id.'_'.$model->filename).'<br />';
					}
					echo $form->fileField($model,'fileupload');
				?>
            </td>
            <td class="td-text-align"><?php echo $form->labelEx($model,'version'); ?></td>
            <td><?php echo $form->textField($model,'version'); ?></td>
        </tr>
        <tr>
            <td class="td-text-align"><?php echo $form->labelEx($model,'user'); ?></td>
            <td>
				<?php
                	//echo $form->textField($model,'user', array('readonly'=>true));
					echo $form->dropDownList($model, 'user', CHtml::listData($users, 'username', 'displayname'), array('disabled'=>true));
				?>
            </td>
            <td class="td-text-align"><?php echo $form->labelEx($model,'installeddate'); ?></td>
            <td>
                <?php
                    $this->widget('zii.widgets.jui.CJuiDatePicker',array(
                    'name'=>'Configuration[installeddate]',
                    'model'=>$model,
                    'attribute'=>'installeddate',
                    // additional javascript options for the date picker plugin
                    'options'=>array(
                        'showAnim'=>'fold',
                        'dateFormat'=>'yy-mm-dd'
                    ),
                    'htmlOptions'=>array(
                        'style'=>'height:16px;'
                    ),
                ));
                ?>
            </td>
        </tr>
        <tr>
            <td class="td-text-align"><?php echo $form->labelEx($model,'description'); ?></td>
            <td colspan="3"><?php echo $form->textArea($model,'description'); ?></td>
        </tr>
        <tr>
        	<td>&nbsp;</td>
            <td align="center" colspan="3">
				<?php echo '<ul style="color:red">' . $error . '</ul>';?>
                <?php echo '<ul style="color:blue">' . $msg . '</ul>';?>            
            </td>
        </tr>
        <tr>
            <td align="center" colspan="4">
            	<div class="row buttons" align="center">
					<?php echo CHtml::submitButton(' Save '); ?>
                    <?php echo CHtml::button(' Cancel ', array('onclick'=>'js:document.location.href="'.Yii::app()->createUrl('configuration/list').'"')); ?>
                </div>
            </td>
        </tr>
    </table>
<?php $this->endWidget(); ?>

</div><!-- form -->